use ztask::task::*;

fn main() {
    let mut s = Sequence::new(vec![
        Lock::new(
            AfterTimes::new(5),
            Parallel::new(
                vec![
                    Log::new("Hello, World") as Box<dyn ITask>,
                    Lock::new(
                        AfterTimes::new(4),
                        Log::new("Hello, China"),
                    ),
                ]
            ),
        ) as Box<dyn ITask>,

        Lock::new(
            AfterTimes::new(3),
            Log::new("A message"),
        ),

        Log::new("Fin"),
    ]);

    let mut i = 0;
    while !s.is_finished() {
        println!("Current Frame {}", i);
        s.step();

        i += 1;
    }
}
